<template>
    <div class="customer-container">
        <h2 class="customer-title">客户案例</h2>
        <el-row>
            <el-col :xs="10" :sm="12" :md="6" :lg="6" v-for="logo in logos" :key="logo.name">
                <div class="logo-item">
                    <img :src="logo.image_url" :alt="logo.name" />
                </div>
            </el-col>
        </el-row>
        <a target="_self" @click="$router.push('/qqkh')" class="service-links">了解更多</a>
    </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { getCustomer } from '@/api/index';

// 模拟的客户数据（实际中可能从API获取）
const logos = ref([]);

onMounted(() => {
    getCustomer().then(res => {
        logos.value = res.data;
    });
});




</script>

<style scoped>
/* 媒体查询：针对1281px及以上的屏幕宽度 */
@media screen and (min-width: 1025px) {
    .logo-item {
        margin-bottom: 20px;

        img {
            max-width: none;
        }
    }

    .service-links {
        display: block;
        border: 1px solid black;
        width: 128px;
        margin: 30px auto;
        font-size: 12px;
        text-align: center;
        padding: 10px 0;
        letter-spacing: 1px;
    }

    .service-links:hover {
        background-color: #409eff;
        color: white;
    }

    .customer-title {
        font-size: 36px;
        text-align: center;
        margin-bottom: 60px;
    }

    .customer-container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-content: center;
        justify-content: flex-start;
        align-items: center;
        padding: 0 150px;
        margin-top: 20px;
    }

    .el-row {
        box-sizing: border-box;
        display: flex;
        flex-wrap: wrap;
        position: relative;
        flex-direction: row;
        align-content: center;
        align-items: center;
    }
}

/* 媒体查询：针对768px到1280px之间的屏幕宽度 */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .logo-item {
        margin-bottom: 20px;

        img {
            max-width: none;
        }
    }

    .service-links {
        display: block;
        border: 1px solid black;
        width: 128px;
        margin: 30px auto;
        font-size: 12px;
        text-align: center;
        padding: 10px 0;
        letter-spacing: 1px;
    }

    .service-links:hover {
        background-color: #409eff;
        color: white;
    }

    .customer-title {
        font-size: 36px;
        text-align: center;
        margin-bottom: 40px;
    }

    .customer-container {
        display: flex;
        flex-direction: column;
        align-content: center;
        justify-content: center;
        align-items: flex-start;
        margin-top: 20px;
        padding: 0 100px;
        width: 100%;
    }

    .el-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* 媒体查询：针对小于768px的屏幕宽度 */
@media screen and (max-width: 768px) {
    .customer-container {
        padding: 0 20px;
        width: 100%;
    }

    .customer-title {
        font-size: 36px;
        text-align: center;
        line-height: 3;
    }

    .el-row {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
        align-content: center;
        align-items: center;
        justify-items: center;
        justify-content: center;
    }

    .logo-item {
        margin-bottom: 20px;
    }

    .service-links {
        display: block;
        border: 1px solid black;
        width: 128px;
        margin: 30px auto;
        font-size: 12px;
        text-align: center;
        padding: 10px 0;
        letter-spacing: 1px;
    }
}
</style>